<style scoped lang="scss">
	.xy-post {
		padding: 18px 14px 51px 14px;
		background: #fff;
		.header {
			display: flex;
			justify-content: space-between;
			.title {
				font-size: 22px;
				font-weight: 500;
				text-align: justify;
			}
		}
		.info {
			padding-top: 15px;
			padding-bottom: 15px;
			font-size: 13px;
			color: #999;
			display: flex;
			justify-content: space-between;
			.left {
				.author {
					color: $uni-color-primary;
				}
			}
		}
		.content {
			font-size: 16px;
			padding-bottom: 18px;
			line-height: 28px;
			text-align: justify;
			word-break: break-all;
			word-wrap: break-word;
			img {
				width: 100% !important;
			}
		}
		.tip {
			color: red;
		}
	}
</style>

<template>
	<view class="xy-post">
		<view class="header">
			<view class="title">
				{{title}}
			</view>
			<view class="titleBadge">
				<slot name="titleBadge">
					{{titleBadge}}
				</slot>
			</view>
		</view>
		<view class="info">
			<slot name="info">
				<view class="left">
					<text class="author m-r-sm" v-if="author">{{author}}</text>
					<text class="time" v-if="postTime">{{postTime | formatTime}}</text>
				</view>
				<view class="right">
					<text v-if="viewCount">阅读 {{viewCount}}</text>
				</view>
			</slot>
		</view>
		<view class="content">
			<rich-text :nodes="content"></rich-text>
		</view>
		<view class="tip m-t" v-if="tip">
			{{tip}}
		</view>
		<view class="comment-box">
			<view class="comment">
			</view>
			<view class="action">
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'XyPost',
		props: {
			title: {
				type: String,
				default: ''
			},
			titleBadge: {
				type: String,
				default: ''
			},
			content: {
				type: String,
				default: ''
			},
			postTime: {
				type: Number,
				default: 0
			},
			viewCount: {
				type: Number,
				default: 0
			},
			author: {
				type: String,
				default: ''
			},
			tip: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
			}
		},
		computed: {
        },
		methods: {
		}
	}
</script>
